﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views {
    import flash.events.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.views.components.*;
    import net.wooga.pets.constants.*;

    public class ElevatorShaftMediator extends RenderListMediator {

        public var elevatorShaftDisplay:ElevatorShaftDisplay;
        public var gameStateModel:GameStateModel;

        override public function onRegister():void{
            super.onRegister();
            this.elevatorShaftDisplay = ElevatorShaftDisplay(getViewComponent());
            eventMap.mapListener(eventDispatcher, BuildingEvent.FACADE_CHANGED, this.toggleFacade);
            eventMap.mapListener(eventDispatcher, CommandConstants.CLEAR_SCENE, this.clearScene);
            updateRenderList();
        }
        public function toggleFacade(_arg1:BuildingEvent=null):void{
            if (this.gameStateModel.isFacadeVisible){
                this.elevatorShaftDisplay.showfrontWall();
            } else {
                this.elevatorShaftDisplay.hidefrontWall();
            };
        }
        private function clearScene(_arg1:Event):void{
            this.elevatorShaftDisplay.remove();
        }

    }
}//package net.wooga.pets.views 
